// 导入 Joi 来定义验证规则
const Joi = require("joi");
// 1. 导入 @escook/express-joi
const expressJoi = require("@escook/express-joi");

const userSchema = {
  //校验 req.body 中的数据
  body: {
    username: Joi.string().alphanum().min(3).max(12).required(),
    password: Joi.string()
      .pattern(/^[\S]{6,15}$/)
      .required(),
  },
};

module.exports = userSchema;
